
<%@page import="fu.abc.DAO.LocationDAO"%>
<%@page import="fu.abc.model.Location"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Vnplace - Quản lý địa điểm</title>
	
	<!-- CSS -->
	<link href="css/transcreate.css" rel="stylesheet" type="text/css" media="screen" />
	<link rel="stylesheet" type="text/css" href="css/viewlocal.css"/>
    
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
	<script src='jquery.js' type='text/javascript'></script>

	<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places"></script>
	<script>
		function initialize() {
			  var mapOptions = {
			    center: new google.maps.LatLng(15.9030623,105.8066925),
			    zoom: 13
			  };
			  var map = new google.maps.Map(document.getElementById('map-canvas'),
			    mapOptions);
	
			  var input = (document.getElementById('address-local'));
// 			  map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
			  var autocomplete = new google.maps.places.Autocomplete(input);
			  autocomplete.bindTo('bounds', map);
	
			  var infowindow = new google.maps.InfoWindow();
			  var marker = new google.maps.Marker({
			    map: map,
			    anchorPoint: new google.maps.Point(0, -29)
			  });
	
			  google.maps.event.addListener(autocomplete, 'place_changed', function() {
			    infowindow.close();
			    marker.setVisible(false);
			    var place = autocomplete.getPlace();
			    if (!place.geometry) {
			      return;
			    }
	
			    // If the place has a geometry, then present it on a map.
			    if (place.geometry.viewport) {
			      map.fitBounds(place.geometry.viewport);
			    } else {
			      map.setCenter(place.geometry.location);
			      map.setZoom(17);  // Why 17? Because it looks good.
			    }
			    /** @type {google.maps.Icon} */
			    marker.setIcon(({
			      url: place.icon,
			      size: new google.maps.Size(71, 71),
			      origin: new google.maps.Point(0, 0),
			      anchor: new google.maps.Point(17, 34),
			      scaledSize: new google.maps.Size(35, 35)
			    }));
			    marker.setPosition(place.geometry.location);
			    marker.setVisible(true);
	
// 			    var address = '';
// 			    if (place.address_components) {
// 			      address = [
// 			        (place.address_components[0] && place.address_components[0].short_name || ''),
// 			        (place.address_components[1] && place.address_components[1].short_name || ''),
// 			        (place.address_components[2] && place.address_components[2].short_name || '')
// 			      ].join(' ');
// 			    }
			  });
	
			  // Sets a listener on a radio button to change the filter type on Places
			  // Autocomplete.
			}
	
		google.maps.event.addDomListener(window, 'load', initialize);
	</script>
	
</head>

<body class="dt-example">
	<div id="wrapper">
		<!-- h1 tag stays for the logo, you can use the a tag for linking the index page -->
		<div id="header">
		<%String acc = (String)session.getAttribute("acc"); %>
		<ul id="header-menu">
			<li><p class="logo">Content-Editor</p></li>
			<li>
			<%

				if(acc==null){
					response.sendRedirect("/Vnplace/systemAdmin/login.jsp");
				}else{
				
 			%>
				<p class="hello">
					Chào <b><%=acc %></b>
				</p>
				<%} %>
			</li>
			<li><a href="/Vnplace/content-editor/logout.jsp" class="logout">Đăng xuất</a></li>
		</ul>
		</div>

		<!-- // #end mainNav -->

		<div id="containerHolder">
			<div id="container">
				<div id="sidebar">
					<ul class="sideNav">
						<li><a href="/Vnplace/content-editor/contenteditor.jsp">Trang chủ</a></li>
						<li><a href="/Vnplace/content-editor/manageLocation.jsp">Quản lý địa điểm</a></li>
						<li class="create"><a href="/Vnplace/content-editor/manageCategory.jsp" >Quản lý nhóm địa điểm</a></li>
						<li class="error"><a href="/Vnplace/content-editor/manageerror.jsp" >Quản lý lỗi</a></li>
					</ul>
					<!-- // .sideNav -->
				</div>
				<!-- // #sidebar -->
				<div id="link-home">
					<ul id="link-ul">
						<li><a href="">Trang chủ</a></li>
						<li><img src="image/12.png" width="15px" height="25px" class="home"/></li>
						<li><a href="editLocation.jsp">Địa điểm</a></li>
					</ul>	 
				</div>
				<%
					String localname = request.getParameter("name");
					Location local = new Location();
					LocationDAO localdao = new LocationDAO();
// 					local = localdao.getLocalNew(localname);
				%>
				
				<div id="main">
<!-- 					<section id="main_content" class="inner"> -->
								<div class="title">
									<p class="ptitle"><%=local.getLocationName() %></p>
								</div>								
								<hr/>
								
								<div id="show-success">
									<ul id="ul-success">
										<li> <img src="image/tich.png" alt="" width="40px" height="40px"/> </li>
										<li><p class="success">Địa điểm của bạn đã được khởi tạo thành công. 
												
										</p></li>
									</ul>
								</div>
								
								<h3 style="margin-left: 30px; font-size: 1.3em">Thông tin cơ bản</h3>
								<hr width="850px"/>
									<div id="map-canvas"></div>
									<div id="label-name">
										<label>Tên địa điểm: </label>
										<p class="name-local"><%=local.getLocationName() %></p>
									</div>
								
									<div id="label-category">
										<label>Nhóm địa điểm: </label>
										<p class="cate-local"><%=local.getCategory() %></p>
									</div>
									
									
									<div id="label-address">
										<label>Tỉnh: </label> 
										<p class="province"><%=local.getProvince() %></p>
										<label>Địa điểm chi tiết: </label>
										<p class="address-local"><%=local.getAddressDetail() %></p>
									</div>
									
									<div id="label-phone">
										<label>Số điện thoại:</label>
										<p class="phone"><%=local.getPhone() %></p>
									</div>
									
									<div id="label-web">
										<label>Website:</label>
										<p class="web"><%=local.getWebsite() %></p>
									</div>
									
									<div id="descript">
										<label>Mô tả chi tiết <span>(*)</span>:</label>
										<p class="descript">
											<%=local.getDescript() %>
										</p>
									</div>
									
									 <div style="margin-top: 10px;">
		                            <script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"> </script>
			                            <ins class="adsbygoogle"
			                                 style="display: inline-block; width: 900px; height: 90px"
			                                 data-ad-client="ca-pub-1704544291315733"
			                                 data-ad-slot="4720331006"></ins>
			                            <script>
		                                (adsbygoogle = window.adsbygoogle || []).push({ });
		                            </script>
                     		  </div>
<!-- 					 </section> -->
<!-- 					 end section -->
				</div>
				<!-- // #main -->
				<div class="clear"></div>
			</div>
			<!-- // #container -->
		</div>
		<!-- // #containerHolder -->
		<div id="footer" class="footer">
			<p class="copyright">©Copyright 2014 Vnplace.vn</p>
		</div>
	</div>

	<!-- // #wrapper -->
</body>
</html>
